package ink.yql.model;

import java.io.Serializable;

/**
 * @author YQL
 */
public class Resources implements Serializable {
    /**
     * 资源id
     */
    private Integer rid;
    /**
     * 资源路径
     */
    private Integer rurl;
    /**
     * 资源类型
     */
    private Integer rtype;
    /**
     * 资源所属人id
     */
    private Integer otherid;

    public Resources(Integer rid, Integer rurl, Integer rtype, Integer otherid) {
        this.rid = rid;
        this.rurl = rurl;
        this.rtype = rtype;
        this.otherid = otherid;
    }

    public Resources() {
    }

    public static ResourcesBuilder builder() {
        return new ResourcesBuilder();
    }

    public Integer getRid() {
        return this.rid;
    }

    public Integer getRurl() {
        return this.rurl;
    }

    public Integer getRtype() {
        return this.rtype;
    }

    public Integer getOtherid() {
        return this.otherid;
    }

    public void setRid(Integer rid) {
        this.rid = rid;
    }

    public void setRurl(Integer rurl) {
        this.rurl = rurl;
    }

    public void setRtype(Integer rtype) {
        this.rtype = rtype;
    }

    public void setOtherid(Integer otherid) {
        this.otherid = otherid;
    }

    public boolean equals(final Object o) {
        if (o == this) return true;
        if (!(o instanceof Resources)) return false;
        final Resources other = (Resources) o;
        if (!other.canEqual((Object) this)) return false;
        final Object this$rid = this.getRid();
        final Object other$rid = other.getRid();
        if (this$rid == null ? other$rid != null : !this$rid.equals(other$rid)) return false;
        final Object this$rurl = this.getRurl();
        final Object other$rurl = other.getRurl();
        if (this$rurl == null ? other$rurl != null : !this$rurl.equals(other$rurl)) return false;
        final Object this$rtype = this.getRtype();
        final Object other$rtype = other.getRtype();
        if (this$rtype == null ? other$rtype != null : !this$rtype.equals(other$rtype)) return false;
        final Object this$otherid = this.getOtherid();
        final Object other$otherid = other.getOtherid();
        if (this$otherid == null ? other$otherid != null : !this$otherid.equals(other$otherid)) return false;
        return true;
    }

    protected boolean canEqual(final Object other) {
        return other instanceof Resources;
    }

    public int hashCode() {
        final int PRIME = 59;
        int result = 1;
        final Object $rid = this.getRid();
        result = result * PRIME + ($rid == null ? 43 : $rid.hashCode());
        final Object $rurl = this.getRurl();
        result = result * PRIME + ($rurl == null ? 43 : $rurl.hashCode());
        final Object $rtype = this.getRtype();
        result = result * PRIME + ($rtype == null ? 43 : $rtype.hashCode());
        final Object $otherid = this.getOtherid();
        result = result * PRIME + ($otherid == null ? 43 : $otherid.hashCode());
        return result;
    }

    public String toString() {
        return "Resources(rid=" + this.getRid() + ", rurl=" + this.getRurl() + ", rtype=" + this.getRtype() + ", otherid=" + this.getOtherid() + ")";
    }

    public static class ResourcesBuilder {
        private Integer rid;
        private Integer rurl;
        private Integer rtype;
        private Integer otherid;

        ResourcesBuilder() {
        }

        public Resources.ResourcesBuilder rid(Integer rid) {
            this.rid = rid;
            return this;
        }

        public Resources.ResourcesBuilder rurl(Integer rurl) {
            this.rurl = rurl;
            return this;
        }

        public Resources.ResourcesBuilder rtype(Integer rtype) {
            this.rtype = rtype;
            return this;
        }

        public Resources.ResourcesBuilder otherid(Integer otherid) {
            this.otherid = otherid;
            return this;
        }

        public Resources build() {
            return new Resources(rid, rurl, rtype, otherid);
        }

        public String toString() {
            return "Resources.ResourcesBuilder(rid=" + this.rid + ", rurl=" + this.rurl + ", rtype=" + this.rtype + ", otherid=" + this.otherid + ")";
        }
    }
}
